function cleanHRInfo() {
	window.top.Dialog.confirm('警告：您确认要清除全部数据吗？',function(){
		var btnObj = jQuery("#cleanBtn");
		var spanObj = jQuery("#cleanMsg");
		var imgObj = jQuery("#cleanImg");
		var url = "/SynHrmCtrl.cleanHrInfo.app";
		jQuery.ajax({
			url: url,
			async:true,
			timeout:1000*60*30,    
		    dataType:"json",
		    beforeSend:function(xhr){
		    	imgObj.show();
		    	btnObj.hide();
		    	spanObj.text("");
		    	disabledBtn();
		    },
		    success:function(o,textStatus,jqXHR){
		    	var text = "本次清空数据:"+o.allNum+";成功:"+o.successNum+";失败:"+o.failNum+";接口执行耗时:"+o.executeTime+";数据清除耗时:"+o.sqlTime+";总耗时:"+o.sumTime;
		    	spanObj.text(text);
		    	
		    },
		    error:function(xhr,textStatus){
		    	spanObj.text("执行异常！");
		    },
		    complete:function(){
		    	imgObj.hide();
		    	btnObj.show();
		    	showBtn();
		    }
		});
	});
}

function synSubCompany() {
	var btnObj = jQuery("#subcompanyBtn");
	var spanObj = jQuery("#subcompanyMsg");
	var imgObj = jQuery("#subcompanyImg");
	var url = "/SynHrmCtrl.synSubCompany.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synDepartment() {
	var btnObj = jQuery("#departmentBtn");
	var spanObj = jQuery("#departmentMsg");
	var imgObj = jQuery("#departmentImg");
	var url = "/SynHrmCtrl.synDepartment.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synJobGroups() {
	var btnObj = jQuery("#jobGroupsBtn");
	var spanObj = jQuery("#jobGroupsMsg");
	var imgObj = jQuery("#jobGroupsImg");
	var url = "/SynHrmCtrl.synJobGroups.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synJobActivities() {
	var btnObj = jQuery("#jobActivitiesBtn");
	var spanObj = jQuery("#jobActivitiesMsg");
	var imgObj = jQuery("#jobActivitiesImg");
	var url = "/SynHrmCtrl.synJobActivities.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synJobTitleTemplet() {
	var btnObj = jQuery("#jobTitleTempletBtn");
	var spanObj = jQuery("#jobTitleTempletMsg");
	var imgObj = jQuery("#jobTitleTempletImg");
	var url = "/SynHrmCtrl.synJobTitleTemplet.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synJobTitle() {
	var btnObj = jQuery("#jobTitleBtn");
	var spanObj = jQuery("#jobTitleMsg");
	var imgObj = jQuery("#jobTitleImg");
	var url = "/SynHrmCtrl.synJobTitle.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synResource() {
	var btnObj = jQuery("#resourceBtn");
	var spanObj = jQuery("#resourceMsg");
	var imgObj = jQuery("#resourceImg");
	var url = "/SynHrmCtrl.synResource.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	var result = o.result;
	    	if(result){
	    		if(result.flag){
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步成功:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+"]");
	    		}else{
	    			spanObj.text("本次执行耗时:["+o.useDate+"];同步失败:[接口数据:"+result.interfaceDataNum+",新增数据:"+result.insertNum+",更新数据:"+result.updateNum+",错误信息:"+result.msg+"]");
	    		}
	    		
	    	}else{
	    		spanObj.text("结果异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function synDepartmentMatrix() {
	var btnObj = jQuery("#departmentMatrixBtn");
	var spanObj = jQuery("#departmentMatrixMsg");
	var imgObj = jQuery("#departmentMatrixImg");
	var url = "/SynHrmCtrl.synDepartmentMatrix.app";
	jQuery.ajax({
		url: url,
		async:true,
		timeout:1000*60*30,    
	    dataType:"json",
	    beforeSend:function(xhr){
	    	imgObj.show();
	    	btnObj.hide();
	    	spanObj.text("");
	    	disabledBtn();
	    },
	    success:function(o,textStatus,jqXHR){
	    	if(o.allNum > 1){
	    		var text = "本次同步数据:"+o.allNum+";同步成功:"+o.successNum+";同步失败:"+o.failNum+";接口执行耗时:"+o.executeTime+";数据更新耗时:"+o.sqlTime+";总耗时:"+o.sumTime;
	    		spanObj.text(text);
	    	}else{
	    		spanObj.text("同步异常！");
	    	}
	    },
	    error:function(xhr,textStatus){
	    	spanObj.text("同步异常！");
	    },
	    complete:function(){
	    	imgObj.hide();
	    	btnObj.show();
	    	showBtn();
	    }
	});
}

function disabledBtn(){
	jQuery(".e8_btn_top").each(function(i,e){
		jQuery(e).attr("disabled","true");
	});
}

function showBtn(){
	jQuery(".e8_btn_top").each(function(i,e){
		jQuery(e).removeAttr("disabled");
	});
}


